package Tao;

import java.util.ArrayList;

public class Shoppingcart {
	ArrayList<Product> prolist = new ArrayList<Product>();
	public void addpro(Product pro){
		prolist.add(pro);
	}
	public  void printlist(){
		System.out.println(prolist);
	}
	public double calprice(){
		double totalprice=0;
		for (int i = 0; i < prolist.size(); i++) {
			totalprice+=prolist.get(i).price*prolist.get(i).num;
		}
		return totalprice;
	}

}
